//created by wzq 确认框类
//需要：css/xy-confirm.css
define(["jquery"],function($){
	function xyConfirm(){
		var template = "<div class='xy-confirm'>" +
		"<div class='xy-confirm-bottomArea'>" +
			"<div class='xy-confirm-contentPanel'>" +
				"<div class='xy-confirm-content'>请确定一下好吗，亲</div>" +
				"<div class='xy-confirm-confirmBtn'>确定</div>" + 
			"</div>" + 
			"<div class='xy-confirm-cancelBtn'>取消</div>" + 
		"</div>" +
	"</div>";
		this.$dom = $(template);
		this.$contentTxt = this.$dom.find(".xy-confirm-content");
		this.$confirmBtn = this.$dom.find(".xy-confirm-confirmBtn");
		this.$cancelBtn = this.$dom.find(".xy-confirm-cancelBtn");

		var self = this;
		this.$confirmBtn.click(function(){
			self.onConfirm && self.onConfirm();
			self.hide();
		});
		this.$cancelBtn.click(function(){
			self.hide();
		});

		$('body').append(this.$dom);
		this.$dom.hide();
	};

	xyConfirm.prototype.setContent = function(c,confirmBtnLabel){
		this.$contentTxt.text(c);
		this.$confirmBtn.text(confirmBtnLabel);
	};

	xyConfirm.prototype.show = function(){
		this.$dom.show();
	};
	
	xyConfirm.prototype.hide = function(){
		this.$dom.hide();
	};
	
	return xyConfirm;
});